﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SqlCe4Mvc3Application1.Models
{
    partial class Common_CommonPartVersionRecord : RaisingStudio.Data.Common.IDataObjectProxy
    {
        #region IDataObjectProxy Members

        public Type GetPropertyType(string name)
        {
            switch (name)
            {                
                case "Id":
                   {
                       return typeof(int);
                   }
                case "ContentItemRecord_id":
                   {
                       return typeof(int?);
                   }
                case "CreatedUtc":
                   {
                       return typeof(DateTime?);
                   }
                case "PublishedUtc":
                   {
                       return typeof(DateTime?);
                   }
                case "ModifiedUtc":
                   {
                       return typeof(DateTime?);
                   }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        #endregion

        #region IObjectAccessor Members

        public object GetValue(object instance, string name)
        {
            Common_CommonPartVersionRecord _instance = instance as Common_CommonPartVersionRecord;
            switch (name)
            {                
                case "Id":
                   {
                       return _instance.Id;
                   }
                case "ContentItemRecord_id":
                   {
                       return _instance.ContentItemRecord_id;
                   }
                case "CreatedUtc":
                   {
                       return _instance.CreatedUtc;
                   }
                case "PublishedUtc":
                   {
                       return _instance.PublishedUtc;
                   }
                case "ModifiedUtc":
                   {
                       return _instance.ModifiedUtc;
                   }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        public void SetValue(object instance, string name, object value)
        {
            Common_CommonPartVersionRecord _instance = instance as Common_CommonPartVersionRecord;
            switch (name)
            {                
                case "Id":
                    {
                        _instance.Id = (int)value;
                        return;
                    }
                case "ContentItemRecord_id":
                    {
                        _instance.ContentItemRecord_id = (int?)value;
                        return;
                    }
                case "CreatedUtc":
                    {
                        _instance.CreatedUtc = (DateTime?)value;
                        return;
                    }
                case "PublishedUtc":
                    {
                        _instance.PublishedUtc = (DateTime?)value;
                        return;
                    }
                case "ModifiedUtc":
                    {
                        _instance.ModifiedUtc = (DateTime?)value;
                        return;
                    }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        #endregion

        #region IObjectCreater Members

        public object CreateObject()
        {
            return new Common_CommonPartVersionRecord();
        }

        public System.Collections.IList CreateObjectList()
        {
            return new System.Collections.Generic.List<Common_CommonPartVersionRecord>();
        }

        #endregion
    }
}
